package com.niuwa.p2p.dao.claimtransfer;

import java.math.BigDecimal;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import com.niuwa.p2p.dao.MyBatisDao;
import com.niuwa.p2p.entity.claimtransfer.TransferApply;

@MyBatisDao
public interface TransferApplyDao {
	
	
	
	/**
	 * 获取符合条件的牛娃账户数
	 * @param paramMap
	 * @return
	 */
	public int searchSelfDebtTransferCountByCondition(Map<String, Object> paramMap);
	/**
	 * 获取符合条件的牛娃账户列表
	 * @return
	 * @throws SQLException
	 */
	public List<TransferApply> searchSelfDebtTransferByCondition(Map<String, Object> paramMap);
	
	public List<TransferApply> selectPlanTransferList(String recordNo);
	
	/**
	 * 更新投资计划转让下债权的状态
	 * @param tranferStatus
	 * @param recordNo
	 * @return
	 */
	int updatePlanClaimByPlanTransferRecordCode(Map map);
	
	/**
	 * 根据自转债权流水号查询信息
	 * @param serialNo
	 * @return
	 */
	public TransferApply selectTransferApplyBySerialNo(String serialNo);
	
	/**
	 * 根据自转债权流水号更新转让状态
	 * @param tranferStatus
	 * @param recordNo
	 * @return
	 */
	int updateStatusBySerialNo(TransferApply record);
	/**
	 * 获取带匹配债权
	 * @return
	 */
	BigDecimal getWaitTransferFund();
	
	int insertSelective(TransferApply record);

	int updateByPrimaryKeySelectiveByVersion(TransferApply transferApply);
	
	
	int insertRecordRelativeApply(Map<String, Object> paramMap);
}